#pragma once
#include "stdafx.h"
#include "Agent.hpp"
#include "PropertyManager.hpp"


class CameraMan: public Ogre::SceneNode, public Agent
{
public:
	CameraMan(Ogre::SceneManager* creator, const Ogre::String& name, Ogre::Camera* camera,
		const Ogre::Vector3& position = Ogre::Vector3::ZERO, 
		const Ogre::Vector3& direction = Ogre::Vector3::NEGATIVE_UNIT_Z);
	virtual ~CameraMan();

	void changeLookingDirection(int dx, int dy);

	bool isGoingForward() const { return goingForward; }
	void setGoingForward(bool val) { goingForward = val; }
	bool isGoingBack() const { return goingBack; }
	void setGoingBack(bool val) { goingBack = val; }
	bool isGoingLeft() const { return goingLeft; }
	void setGoingLeft(bool val) { goingLeft = val; }
	bool isGoingRight() const { return goingRight; }
	void setGoingRight(bool val) { goingRight = val; }

	virtual void update(float dt);

	virtual AgentType getType() const { return AGENT_DIVER; }

	virtual float getMass() const { return PM.diver.mass->getRealValue(); }
	virtual float getRadius() const { return PM.diver.radius->getRealValue(); }
	virtual float getMaxVelocity() const { return PM.diver.maxVelocity->getRealValue(); }
	virtual float getTurnRate() const { return PM.diver.turnRate->getRealValue(); }

	virtual void draw() const {}

private:
	Ogre::Camera* camera;

	bool goingForward;
	bool goingBack;
	bool goingLeft;
	bool goingRight;
	
	virtual vec3 calcSteeringForce(float dt);
};